package igou.togogo.controller;

import igou.togogo.bean.EBrand;
import igou.togogo.service.IBrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@Controller
public class indexController {

    @Autowired
    IBrandService brandService;

    @RequestMapping("/index")
    public String showIndex(Model model, HttpServletRequest request){
        List<EBrand> list = brandService.getBrandList();
        request.getSession().setAttribute("brandList",list);
        model.addAttribute("brandList",list);
        return "front_page/product/product";
    }
}
